<template>
	<view class="business">
		<!-- <view class="carousel-section">
			<swiper class="carousel" @change="swiperChange">
				<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item">
					<image :src="item.src" />
				</swiper-item>
			</swiper>
		</view> -->
		
		<view class="business-nav">
			<view class="item-nav" v-for="(item,index) in cateGory" :key="index" @click="navClick(item.id)">
				<image :src="item.picUrl" mode=""></image>
				<view class="img-right">
					<h4 class="nav-title">{{item.categoryName}}</h4>
					<view class="line" :style="'background:' + item.bgColor"></view>
					<view class="nav-subTitle">{{item.placeHolderText}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				carouselList:[
					{
						src: '/static/img/index_slices/home_banner.png',
					},
					{
						src: '/static/img/index_slices/home_banner.png',
					}
				],
				cateGory:[
					{
						bgColor:'#6B84C6',
					},
					{
						bgColor:'#E0A533',
					},
					{
						bgColor:'#6B4CCE',
					},
					{
						bgColor:'#33B1B0',
					},
					{
						bgColor:'#D08548',
					},
					{
						bgColor:'#D8CE2D',
					},
					{
						bgColor:'#89B695',
					},
					{
						bgColor:'#C66BA7',
					}
				]
			}
		},
		onLoad(){
			// 商品分类
			this.tui.request(
				'/app/material/getMaterialCategory',
				'GET', {
					categoryType: 2,
				},
				false,
				false,
				false,
			).then(res => {
				this.cateGory = res.data.list;
			
			}).catch(err => {
				console.log(err)
			})
		},
		
		methods:{
			// 图片事件
			swiperChange(){
				
			},
			navClick(item){
				uni.navigateTo({
					url: "./infomation?id=" + item,
				})
			}
			// open:function(url){
			// 	uni.navigateTo({
			// 		url: url,
			// 	})
			// }
		}
		
	}
</script>

<style lang="scss">
	.business{
		
		/* 头部 轮播图 */
		.carousel-section {
			position: relative;
			// margin-top: 88upx;
			/* #ifdef APP-PLUS */
			// padding-top: var(--status-bar-height);
			/* #endif */
		
			.titleNview-placing {
				/* #ifdef APP-PLUS */
				// padding-top: var(--status-bar-height);
				/* #endif */
				// margin-top: 88upx;
				box-sizing: content-box;
			}
		
			.titleNview-background {
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 460upx;
				transition: .4s;
			}
		}
		
		.carousel {
			width: 100%;
			height: 350upx;
		
			.carousel-item {
				width: 100%;
				height: 100%;
				// padding: 0 28upx;
				overflow: hidden;
			}
		
			image {
				width: 100%;
				height: 100%;
				// border-radius: 10upx;
			}
		}
		
		uni-swiper-dot {
			width: 37px !important;
			height: 4px !important;
			border-radius: inherit !important;
			background-color: #cccccc !important;
		}
	
		.business-nav{
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			padding: 0 30upx;
			margin-bottom: 114upx;
			
			.item-nav{
				width: 325upx;
				height: 171upx;
				background-color: #F8F7FC;
				border-radius:14upx;
				display: flex;
				align-items: center;
				margin-top: 40upx;
				
				image{
					width: 109upx;
					height: 109upx;
					
				}
				
				.nav-title{
					font-size:32upx;
					font-family:Source Han Sans CN;
					font-weight:500;
					color:rgba(0,0,0,1);
					line-height:70upx;
					
				}
				.line{
					width:40upx;
					height:4upx;
					
				}
				
				.nav-subTitle{
					font-size:24upx;
					font-family:Source Han Sans CN;
					font-weight:400;
					color:rgba(128,128,128,1);
					line-height:70upx;
				}
			}
		}
	}
</style>
